#include <stdio.h>

int main(void)
{
    int i, j, n;
    float value = 1, demo;

    printf("Enter the value: ");
    scanf("%d", &n);

    for (i = 1; i <= n; i++)
    {
        for (demo = 1, j = 1; j <= i; j++)
        {
            demo *= j;
        }

        value += 1 / demo;
    }

    printf("The valie of e is %.10f", value);

    return 0;
}